<template>
    <div>
        <div class="header_con">
                <div class="header">
                    <div class="welcome fl">欢迎来到美多商城!</div>
                    <div class="fr">
                        <div v-if="username" class="login_btn fl">
                            欢迎您：<em>{{username}}</em>
                            <span>|</span>
                            <a @click="logout">退出</a>
                        </div>
                        <div v-else class="login_btn fl">
                            <a href="login.html">登录</a>
                            <span>|</span>
                            <a href="register.html">注册</a>
                        </div>
                        <div class="user_link fl">
                            <span>|</span>
                            <a href="user_center_info.html">用户中心</a>
                            <span>|</span>
                            <a href="cart.html">我的购物车</a>
                            <span>|</span>
                            <a href="user_center_order.html">我的订单</a>
                        </div>
                    </div>
                </div>
            </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    props: {
        username: {
            type: String,
            default: ''
        }
    },
    data() {
        return {
            
        }
    },
    methods: {
        logout() {
            this.$emit('login_out', sessionStorage.removeItem('username'))
        }
    },
    created() {

    }
}
</script>

<style scoped>

</style>
